import java.util.Hashtable;
import java.util.StringTokenizer;


class P409_39643 {

	static String readLn() {
		String newLine = System.getProperty("line.separator");
		StringBuffer buffer = new StringBuffer();
		int car = -1;
		try {
			car = System.in.read();
			while ((car > 0) && (car != newLine.charAt(0))) {
				buffer.append((char) car);
				car = System.in.read();
			}
			if (car == newLine.charAt(0))
				System.in.skip(newLine.length() - 1);
		} catch (java.io.IOException e) {
			return (null);
		}
		if ((car < 0) && (buffer.length() == 0))
			return (null);
		return (buffer.toString()).trim();
	}

	public static void main(String[] args) {
		String line = readLn();
		
		int cases = 1;
		
		while (line != null) {
			System.out.println("Excuse Set #" + cases);
			cases++;
			
			StringTokenizer st = new StringTokenizer(line);
			
			int k = Integer.parseInt(st.nextToken());
			int e = Integer.parseInt(st.nextToken());
			
			process(k, e);
			
			line = readLn();
			System.out.println();
		}
	}

	private static void process(int k, int e) {
		Hashtable table = new Hashtable();
		
		for (int i = 0; i < k; i++) {
			String line = readLn();
			table.put(line, line);
		}
		
		String[] excuses = new String[e];
		int[] excusesCounter = new int[e]; 
		
		for (int i = 0; i < e; i++) {
			excuses[i] = readLn();
			StringTokenizer st = new StringTokenizer(excuses[i], "@#;'\".,!?& ");
			
			while (st.hasMoreTokens()) {
				String t = st.nextToken().toLowerCase();
//				System.out.println(t);
				if (table.get(t) != null) excusesCounter[i]++;
			}
			
		}
		
		int max = -1;
		
		for (int i = 0; i < e; i++) {
			if (max < excusesCounter[i]) max = excusesCounter[i];
		}
		
		for (int i = 0; i < e; i++) {
			if (max == excusesCounter[i]) System.out.println(excuses[i]);
		}
		
	}
}
